﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignPatterns
{
    /// <summary>
    /// 海上物流
    /// </summary>
    public class AtSeaLogistics : ILandLogistics
    {
        /// <summary>
        /// 海上发货
        /// </summary>
        public void SendLandGoods(string goodName)
        {
            Console.WriteLine("海上 Send：" + goodName);
        }
    }

    public interface ILandLogistics
    {
        void SendLandGoods(string goodName);
    }

    /// <summary>
    /// 陆地物流
    /// </summary>
    public class LandLogistics : ILandLogistics
    {
        /// <summary>
        /// 陆地发货
        /// </summary>
        public void SendLandGoods(string goodName)
        {
            Console.WriteLine("陆地 Send：" + goodName);
        }
    }

    /// <summary>
    /// 物流管理，主要用于发货
    /// </summary>
    public class EasyFactory
    {
        public static ILandLogistics GetSendInterface(int type)
        {
            switch (type)
            {
                case 1:
                    return new LandLogistics();
                case 2:
                    return new AtSeaLogistics();
            }

            return null;
        }
    }

}
